[Unit]
Description=Flink
After=yarn-resourcemanager.service

[Service]
Environment=JAVA_HOME={{ java_home }}
Environment=HADOOP_HOME={{ usr_local }}/hadoop
Environment=HADOOP_CONF_DIR={{ usr_local }}/hadoop/etc/hadoop
Environment=HADOOP_CLASSPATH={{ hadoop_classpath }}
Type=forking
User=vagrant
ExecStart={{ flink_home }}/bin/yarn-session.sh -d -jm 1024 -tm 1024 -s 2
RemainAfterExit=yes
ExecStop={{ flink_home }}/bin/stop-flink-yarn.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target
